#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QVector>
#include <QList>
#include <QPoint>
#include <QEvent>
#include <QColor>
#include "shape.h"
#include <QLinkedList>

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

    Shape::drawMode mode;
    Shape *shape;
    bool isDone;
    QList<Shape*> shapeList;
    //QList shapeList;
    QList<QPoint> polygen_point_array;
    QVector<QPoint> freehand_point_array;
    QPoint freePoint;
    void paintEvent(QPaintEvent *event);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);
    void mouseReleaseEvent(QMouseEvent *event);

    int penWidth;
    QColor penColor;


private slots:


    void on_actionLine_clicked();

    void on_actionRectangle_clicked();

    void on_actionEllipse_clicked();

    void on_actionPolygon_clicked();

    void on_actionFreehand_clicked();

    void on_actionDelete_clicked();

    void on_toolButton_clicked();

private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
